package io.gitee.wiqer.example.swagger.web;


import io.gitee.wiqer.common.core.web.controller.BaseController;
import io.swagger.annotations.*;
import org.springframework.web.bind.annotation.*;

/**
 * 前后端入门swagger的示例
 * @author lilan
 */
@RestController
@RequestMapping("/swagger")
@Api(value="swagger入门接口",produces="produces",consumes="consumes",protocols="protocols")
public class SwaggerController extends BaseController {

    @ApiOperation(notes = "对该方法的备注信息说明", value = "说明该方法的作用和用途")
    @GetMapping("/hello")
    public String health() {
        return  "hello";
    }
    @ApiResponses({
            @ApiResponse(code=400,message="请求参数没填好"),
            @ApiResponse(code=404,message="请求路径没有或页面跳转路径不对")
    })
    @PostMapping("/echo")
    public String echo(@ApiParam(name = "myMsg", value = "消息", required = false)  @RequestParam(value = "msg", required = false) String msg) {
        return  "hello";
    }
}
